// Default empty project template
#ifndef DemoBtn_HPP_
#define DemoBtn_HPP_

#include <QObject>
#include <bb/cascades/AbstractPane>
#include <bb/cascades/Color>
#include <bb/cascades/Container>
#include <bb/cascades/DockLayout>
#include <bb/cascades/ImageView>
#include <bb/cascades/Page>
#include <bb/cascades/Slider>
#include <bb/cascades/Stacklayout>
#include <bb/cascades/StackLayoutProperties>
#include <bb/cascades/AbsoluteLayoutProperties>
#include <bb/cascades/Label>
#include <QTimer>
#include "ShowText.h"
#include <bb/cascades/TouchBehavior>
#include <bb/cascades/TouchEvent>
#include <QList>
#include <QGlobal.h>
#include <QTime>

namespace bb { namespace cascades { class Application; }}

/*!
 * @brief Application pane object
 *
 *Use this object to create and init app UI, to create context objects, to register the new meta types etc.
 */
class DemoBtn : public QObject
{
    Q_OBJECT
public:
    DemoBtn(bb::cascades::Application *app);
    virtual ~DemoBtn() {};

private:
    void createLayout();
    bb::cascades::AbstractPane *root;

private:
    void createTimer();

private slots:
    void update();
    void showLog(QString msg);
private:
    QList<bb::cascades::Container*> cList;
    QList<ShowText*> textList;

    QList<ShowText*> gamePlayList;
    QTimer *timer;
    int index;
    int interval;
    int nowTime;
    int containerNow;

    void addTouchHandler();
    void findOtherContainer();
    void createTempData();
    int randInt(int low, int high);
public:
    Q_INVOKABLE void changeText(int x, int y);
    Q_INVOKABLE void handleTouch(int x, int y);
};


#endif /* DemoBtn_HPP_ */
